package com.jiang.myfm.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.jiang.myfm.LoginActivity;
import com.jiang.myfm.MainActivity;
import com.jiang.myfm.R;

/**
 * Created by Administrator on 2016/12/2.
 */
public class Myfragment extends Fragment {
//    private Intent intent = new Intent(getActivity(), LoginActivity.class);
    private ImageView iv;
    private RelativeLayout meg;
    private TextView tv;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.myfragment, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        tv = (TextView) view.findViewById(R.id.tv_login);
        iv = (ImageView) view.findViewById(R.id.iv);
        meg = (RelativeLayout) view.findViewById(R.id.message);
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getContext(),LoginActivity.class);
                startActivity(intent);
            }
        });
        iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getContext(),LoginActivity.class);
                startActivity(intent);
            }
        });
        meg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(getContext(),LoginActivity.class);
                startActivity(intent);
            }
        });
    }
}
